CombineToPDF(IEnumerable<String>,String,PdfConformance) Method
In This Topic
This method combines all the specified input files to a single PDF document and saves the resulting file according to a file path you have specified.
The PDF version or the PDF conformance level of the resulting PDF document is set according to the given Conformance parameter.
Syntax
'Declaration
Public Overloads Function CombineToPDF( _
ByVal As IEnumerable(Of String), _
ByVal As String, _
Optional ByVal As PdfConformance _
) As GdPictureStatus
public GdPictureStatus CombineToPDF(
IEnumerable<string> ,
string ,
PdfConformance
)
public function CombineToPDF(
: IEnumerable;
: String;
: PdfConformance
): GdPictureStatus;
public function CombineToPDF(
: IEnumerable,
: String,
: PdfConformance
) : GdPictureStatus;
public: GdPictureStatus CombineToPDF(
IEnumerable<string*>* ,
string* ,
PdfConformance
)
public:
GdPictureStatus CombineToPDF(
IEnumerable<String^>^ ,
String^ ,
PdfConformance
)
Parameters
- InputFiles
- An array of strings defining the file paths of all the documents you want to combine.
- DestFile
- The file path where the destination file will be saved. If the specified file already exists, it will be overwritten.
- Conformance
- A member of the PdfConformance enumeration. Specifies the required PDF version or conformance to the PDF or PDF/A standard of the resulting PDF document.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
Example
Combining multiple files of different formats to a single PDF document.
Dim inputFiles As IEnumerable(Of String) = New List(Of String)(New String() {"d:\image.jpg", "d:\document.pdf", "d:\image.tif", "d:\todo_list.xlsx"})
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
gdpictureDocumentConverter.CombineToPDF(inputFiles, "d:\merged.pdf", PdfConformance.PDF1_5)
End Using
IEnumerable<string> inputFiles = new List<string>(new string[] { "d:\\image.jpg", "d:\\document.pdf", "d:\\image.tif", "d:\\todo_list.xlsx" });
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
gdpictureDocumentConverter.CombineToPDF(inputFiles, "d:\\merged.pdf", PdfConformance.PDF1_5);
}
Example
Combining multiple files of different formats to a single PDF document.
Dim inputFiles As IEnumerable(Of String) = New List(Of String)(New String() {"d:\image.jpg", "d:\document.pdf", "d:\image.tif", "d:\todo_list.xlsx"})
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
gdpictureDocumentConverter.CombineToPDF(inputFiles, "d:\merged.pdf", PdfConformance.PDF1_5)
End Using
IEnumerable inputFiles = new List(new string[] { "d:\\image.jpg", "d:\\document.pdf", "d:\\image.tif", "d:\\todo_list.xlsx" });
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
gdpictureDocumentConverter.CombineToPDF(inputFiles, "d:\\merged.pdf", PdfConformance.PDF1_5);
}
See Also